<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('项目详情')"/>
    <th:block th:include="include :: jsonview-css"/>
    <style>
        .label-left {
            padding-top: 7px;
            margin-bottom: 0;
            text-align: left;
        }
        .div-content {
            word-wrap: break-word;margin-bottom: 0;border-bottom: solid 1px #ccc;margin-top: 10px;
        }
    </style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m-t" id="signupForm">
        <div class="form-group" style="margin: -15px;">
            <label class="col-sm-12" style="font-weight: bold;">项目详情</label>
        </div>
        <hr>
        <div class="form-group">
            <label class="col-sm-2 control-label">项目名称：</label>
            <div class="form-control-static" th:text="${projects.projectName}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">立项时间：</label>
            <div class="form-control-static" th:text="${#dates.format(projects.approvalTime, 'yyyy-MM-dd')}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">项目描述：</label>
            <div class="form-control-static col-sm-8" th:utext="${projects.content}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">项目附件：</label>
            <div class="form-control-static col-sm-10">
                <ul style="margin-left: -30px">
                    <li style="margin-bottom: 5px" th:each="file: ${projects.fileList}">
                        [[${file.fileName}]]
                        <a class="btn btn-info btn-xs" th:onclick="prevFile([[${file.url}]])"><i class="fa fa-search"></i>预览</a>
                        <a class="btn btn-warning btn-info btn-xs" th:href="${file.url}"><i class="fa fa-cloud-download"></i>下载</a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-5">
                <label class="col-sm-5 control-label">计划开始时间：</label>
                <div class="col-sm-6 form-control-static"
                     th:text="${#dates.format(projects.plannedStartTime, 'yyyy-MM-dd')}"></div>
            </div>
            <div class="col-sm-5">
                <label class="col-sm-5 control-label">计划开始时间：</label>
                <div class="col-sm-6 form-control-static"
                     th:text="${#dates.format(projects.plannedEndTime, 'yyyy-MM-dd')}"></div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">项目成员：</label>
            <div class="form-control-static">
                <span th:each="user : ${projects.userList}" th:text="${user.userName}" style="margin-left: 5px"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-5">
                <label class="col-sm-5 control-label">项目负责人：</label>
                <div class="col-sm-6 form-control-static" th:text="${projects.owner.userName}"></div>
            </div>
            <div class="col-sm-5">
                <label class="col-sm-5 control-label">项目状态：</label>
                <div class="col-sm-6">
                    <select style="margin-left: -20px;" disabled th:field="${projects.status}" class="form-control"
                            name="status" th:with="type=${@dict.getType('project_status')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-5">
                <label class="col-sm-5 control-label">部门：</label>
                <div class="col-sm-6 form-control-static" th:text="${projects.department}"></div>
            </div>
            <div class="col-sm-5">
                <label class="col-sm-5 control-label">项目进度：</label>
                <div class="col-sm-6 form-control-static" th:text="${projects.progressRate} + '%'"></div>
            </div>
        </div>
        <div class="form-group" style="margin: 15px 0 -15px -15px;">
            <label class="col-sm-12" style="font-weight: bold;">项目进展记录</label>
        </div>
        <hr>
        <div class="col-sm-6" style="margin-bottom: 0; border: #CCCCCC solid 1px">
            <div class="form-group" style="margin-bottom: 0; border-bottom: #CCCCCC solid 1px">
                <label class="col-sm-4 label-left" style="font-weight: bold;">日期</label>
                <div class="label-left col-sm-8" style="font-weight: bold;">项目进展</div>
            </div>
            <div class="form-group div-content" th:each="progress: ${projects.progressList}">
                <label class="col-sm-4 label-left"
                       th:text="${#dates.format(progress.createTime, 'yyyy-MM-dd')}"></label>
                <div class="form-control-static col-sm-8" th:utext="${progress.progressContent}"></div>
            </div>
        </div>
        <div class="col-sm-6" style="margin-bottom: 0; border: #CCCCCC solid 1px">
            <div class="form-group" style="margin-bottom: 0; border-bottom: #CCCCCC solid 1px">
                <label class="col-sm-4 label-left" style="font-weight: bold;">日期</label>
                <div class="label-left col-sm-8" style="font-weight: bold;">技术协议进展</div>
            </div>
            <div class="form-group div-content" th:each="progress: ${projects.technicalAgreementProgressList}">
                <label class="col-sm-4 label-left"
                       th:text="${#dates.format(progress.createTime, 'yyyy-MM-dd')}"></label>
                <div class="form-control-static col-sm-8" th:utext="${progress.progressContent}"></div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script>
    function prevFile(url) {
        $.modal.open("PDF预览", ctx + "common/pdfPreview?url="+url, 1200, 800);
    }
</script>
</body>
</html>